package woaini.wind.bot.rasa.utils;

import lombok.experimental.UtilityClass;

import java.time.LocalDate;
import java.util.List;

/**
 * @see woaini.wind.bot.rasa.utils.DateTool
 * @author yefeng {@date 2024-12-06 15:10:40}
 */
@UtilityClass
public class DateTool {

  public static final List<String> DAYS = List.of("前天","昨天","今天", "明天", "后天");

  public static final int TO_DAY_INDEX = 2;

  public LocalDate getDateWithDay(String day) {
      //获取下标
    int index = DAYS.indexOf(day);
    return LocalDate.now().plusDays(index - TO_DAY_INDEX);
  }
}
